package com.electromagnetic.industry.software.manage.pojo.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.electromagnetic.industry.software.common.util.EleIdCreator;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("ed_user_role")
public class UserRole extends BaseModel {

    /**
     * 主键ID
     */
    private String id;

    /**
     * 用户编码
     */
    @TableField(value = "user_id")
    private String userId;

    /**
     * 角色编码
     */
    @TableField(value = "role_id")
    private String roleId;

    public void newInit() {
        this.setId(EleIdCreator.createSnowflakeId());
    }
}
